<template>
	<view class="my-search-container" :style="{'background-color' : bgcolor}" @click="searchBoxHandler">
		<view class="my-search-box" :style="{'border-radius' : radius + 'rpx'}">
			<uni-icons type="search" size="17"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default {
		name:"my-search",
		props : {
			// 背景颜色
			bgcolor : {
				type : String,
				default : '#C00000'
			},
			// 圆角尺寸
			radius : {
				type : Number,
				 // 单位是 rpx
				default : 36
			}
		},
		data() {
			return {
				
			};
		},
		methods : {
			searchBoxHandler(){
				this.$emit('click')
			}
		}
	}
</script>

<style lang="scss">
	.my-search-container{
		height: 100rpx;
		// background-color: #C00000;
		display: flex;
		align-items: center;
		padding: 0 20rpx;
		
		.my-search-box{
			height: 72rpx;
			background-color: #FFFFFF;
			// border-radius: 36rpx;
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			
			.placeholder{
				font-size: 30rpx;
				margin-left: 10rpx;
			}
		}
	}
</style>